package written.test;

import java.util.Scanner;

/**
 * @Author: Dang Qi
 * @Date: 2021/4/17  15:28
 * @Description:
 */
public class ThreeSixZero2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        solve(s.toCharArray());
    }
    public static void solve(char[] s){
        int n = s.length;
        long mod = 1000000007;
        long ans = 0;
        long  b_num = 0;
        for(int i = n-1; i >=0; i--){
            if(s[i] == 'b') b_num++;
            if(s[i] =='a'){
                ans += b_num % mod;
                b_num *= 2;
                b_num = b_num % mod;
            }
        }
        System.out.println(ans % mod);
    }
}
